// Copyright DustedPixels.com 2008. All rights reserved.

package com.dustedpixels.jasmin.unit.math;

import com.dustedpixels.jasmin.unit.Unit;

/**
 * Clocked D-Type Flip Flop.
 * 
 * @author micapolos@gmail.com (Michal Pociecha-Los)
 */
public final class DFlipFlip32 implements Unit {
  // (input) clock source
  public boolean CLOCK = false;
  
  // (input) data input
  public int IN = 0;
  
  // (output) data output
  public int OUT;
  
  private boolean lastClock = false;
  
  public void updateEndPoints() {
    if (lastClock != CLOCK) {
      if (CLOCK) {
        OUT = IN;
      }
      lastClock = CLOCK;
    }
  }
}
